//
//  ScrollAnPageControl.m
//  UI_个人项目—播放器
//
//  Created by dlios on 15-8-21.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "ScrollAnPageControl.h"
#import "BaseView.h"

@implementation ScrollAnPageControl
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.scroll = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
        //self.scroll.backgroundColor = [UIColor purpleColor];
        self.scroll.contentSize = CGSizeMake(self.frame.size.width*7, 0);
        self.scroll.pagingEnabled = YES;
        self.scroll.showsHorizontalScrollIndicator = NO;
        self.scroll.contentOffset = CGPointMake(self.frame.size.width, 0);
        [self addSubview:self.scroll];
        
        self.page = [[UIPageControl alloc] initWithFrame:CGRectMake(self.frame.size.width-237.5, self.frame.size.height-25, 100, 25)];
        //self.page = [[UIPageControl alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
        self.page.numberOfPages = 5;
        self.page.currentPageIndicatorTintColor = [UIColor whiteColor];
        self.page.pageIndicatorTintColor = [UIColor grayColor];
        [self addSubview:self.page];
        
//        self.buttonLeft = [UIButton buttonWithType:UIButtonTypeSystem];
//        self.buttonLeft.frame = CGRectMake(10, 25, 30, 30);
//        //self.buttonLeft.backgroundColor = [UIColor blueColor];
//        [self.buttonLeft setBackgroundImage:[UIImage imageNamed:@"youjian.png"] forState:UIControlStateNormal];
//        [self addSubview:self.buttonLeft];
        
//        self.zhongView = [[BaseView alloc] initWithFrame:CGRectMake(130, 25, 95, 30)];
//        [self addSubview:self.zhongView];
//        self.label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 65, 30)];
//        [self.zhongView addSubview:self.label];
//        self.label.text = @"城市";
//        self.label.textAlignment = 2;
//        self.label.textColor = [UIColor whiteColor];
//        self.img = [[UIImageView alloc] initWithFrame:CGRectMake(65, 0, 30, 30)];
//        [self.zhongView addSubview:self.img];
//        self.img.image = [UIImage imageNamed:@"hudong.png"];
//        
//        self.buttonRight = [UIButton buttonWithType:UIButtonTypeSystem];
//        self.buttonRight.frame = CGRectMake(305, 25, 60, 30);
//        //self.buttonRight.backgroundColor = [UIColor redColor];
//        [self.buttonRight setTitle:@"添加客户" forState:UIControlStateNormal];
//        self.buttonRight.tintColor = [UIColor whiteColor];
//        [self addSubview:self.buttonRight];
    }
    return self;
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/





@end
